package com.luoye.sr.ws.resource;

import com.luoye.sr.service.IHelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

/**
 * Created by Administrator on 2018/5/31.
 */
@Component
@Path("/hi")
public class HiResource {

    @Autowired
    IHelloService helloService;

    @GET
    @Path("/say")
    @Consumes(MediaType.APPLICATION_JSON)//标注可接受请求的MIME媒体类型
    @Produces(MediaType.APPLICATION_JSON)//标注返回的MIME媒体类型
    public String say(@RequestParam String name){

        return helloService.say(name);
    }

}
